extends Control


var data


signal edit(data)
signal delete(data)


func _ready():
	pass 



func set_data(data):
	self.data = data
	
	var id = data["id"]
	$id.text = str(id)
	
	$name.text = data["name"]
	$name.hint_tooltip = data.get("remark", "")
	
	var type_text = "普通对话"
	if data["type"] == 1:
		type_text = "组合对话"
	
	if data["type"] == 2:
		type_text = "随机对话"
	
	$type.text = type_text

	


func _on_edit_button_up():
	emit_signal("edit", data)


# 点击删除
func _on_del_button_up():
	emit_signal("delete", data)
